Skip to content

fix(dev-server): listen on 127.0.0.1 by default - #845

Merged
ld-ahartmann merged 2 commits into
mainfrom
devin/1791048274-dev-server-localhost
Oct 7, 2026
Merged

ld-ahartmann merged 2 commits into
mainfrom
devin/1791048274-dev-server-localhost

Conversation

@wchieng

@wchieng wchieng commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The dev server listened on 0.0.0.0 with no authentication. Anyone on the same network could read and override flags, replace the database via backup restore, or post unbounded SDK events.

// before
addr := fmt.Sprintf("0.0.0.0:%s", serverParams.Port)
// after
addr := net.JoinHostPort(serverParams.Host /* default "127.0.0.1" */, serverParams.Port)
  • New persistent flag --host (also LD_HOST / config host). It defaults to 127.0.0.1.
  • Behavior change: if you run the dev server in Docker with -p, or reach it from a phone or emulator on the LAN, you now need --host 0.0.0.0. This needs a release note.
  • Request body size limits and debug_events retention will come in a separate PR.

Link to Devin session: https://app.devin.ai/sessions/33518e0108ac4ea3aaec26dd594dbd62
Open in Devin Desktop: https://app.devin.ai/desktop/session/33518e0108ac4ea3aaec26dd594dbd62?variant=devin
Requested by: @wchieng


Note

Overview
Security-focused behavior change: the dev server no longer binds to all interfaces (0.0.0.0) by default; it listens on 127.0.0.1 unless overridden.

Adds a persistent --host flag (default 127.0.0.1), host in ldcli config, and LD_HOST via viper. The listen address is built with net.JoinHostPort instead of hard-coded 0.0.0.0. When the server starts on loopback/localhost, it logs a hint to pass --host 0.0.0.0 for Docker, LAN, or emulator access. Config help golden and Update tests cover the new setting.

Reviewed by Cursor Bugbot for commit ec0da06. Bugbot is set up for automated code reviews on this repo. Configure here.

Add a --host flag (LD_HOST / config 'host') so the server can still be
exposed with --host 0.0.0.0 when running in a container or for other
devices on the network.

Co-Authored-By: wchieng@launchdarkly.com <williamchieng1991@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@ld-ahartmann

Copy link
Copy Markdown
Contributor

@BugBot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4109095. Configure here.

Comment thread cmd/cliflags/flags.go Resolved
Comment thread internal/dev_server/dev_server.go Resolved
…und to loopback

Co-Authored-By: wchieng@launchdarkly.com <williamchieng1991@gmail.com>
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 5, 2026 19:18
@devin-ai-integration
devin-ai-integration Bot requested a review from a team as a code owner October 5, 2026 19:18
@ld-ahartmann
ld-ahartmann merged commit 1854c86 into main Oct 7, 2026
10 checks passed
@ld-ahartmann
ld-ahartmann deleted the devin/1791048274-dev-server-localhost branch October 7, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants